473,424 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,424 software developers and data experts.

cancelling shift-left-click event

I am developing a calendar on which dates can be clicked and selected.
A calendar is a table in which each day is a cell. Each cell has a
unique id.

By left-clicking on a date, it gets selected (with a blue background).
By then shift-left-clicking on another date, the range between the
first and second dates gets selected. This is a behavior commonly found
on GUI widgets. Therefore, I need to cancel the onMouseDown event so
the browser does not select the text by responding to shift-left-click
event. If I don't, the date cells get selected, but so is the text.

Simply returning false from the event handler works for Firefox but
doesn't for Internet Explorer 6. I tried setting cancelBubble to true
and returnValue to false to no avail. However, displaying an alert()
window prevents the selection, though I do not know if this is an
artifact from the window losing the focus. A post in this group
(http://tinyurl.com/g5au4) stated that "the alert is necessary for the
'return false' to properly work".

Setting a timer from onMouseDown to clear the selection does work, but
the selection is visible on screen for a fraction of second before
getting cleared. That's not a viable solution for me.

How do I prevent Internet Explorer (5.5+ if possible) from selecting
text when the user left-clicks with the shift key pressed?

Thank you,
Jonathan

Jun 18 '06 #1
1 3527
jo***************@gmail.com wrote:
I am developing a calendar on which dates can be clicked and selected.
A calendar is a table in which each day is a cell. Each cell has a
unique id.

By left-clicking on a date, it gets selected (with a blue background).
By then shift-left-clicking on another date, the range between the
first and second dates gets selected. This is a behavior commonly found
on GUI widgets. Therefore, I need to cancel the onMouseDown event so
the browser does not select the text by responding to shift-left-click
event. If I don't, the date cells get selected, but so is the text.

Simply returning false from the event handler works for Firefox but
doesn't for Internet Explorer 6. I tried setting cancelBubble to true
and returnValue to false to no avail. However, displaying an alert()
window prevents the selection, though I do not know if this is an
artifact from the window losing the focus. A post in this group
(http://tinyurl.com/g5au4) stated that "the alert is necessary for the
'return false' to properly work".

Setting a timer from onMouseDown to clear the selection does work, but
the selection is visible on screen for a fraction of second before
getting cleared. That's not a viable solution for me.

How do I prevent Internet Explorer (5.5+ if possible) from selecting
text when the user left-clicks with the shift key pressed?


Was that question off-topic or a faq? This newsgroup seems to be very
active and no answer could mean that's not a question you'd want to
answer or it was too difficult... just kiddin'.

Thanks for everybody's time anyways.
Jonathan

Jun 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Alex Stevens | last post by:
Hi All, I'm writing a launcher program which checks for updates and copies them down to the client. However, I would like the user to be able to modify the settings for the launcher. As this...
3
by: mgw | last post by:
Hi, I'm trying to cancel the Shift+F3 key combination in Netscape 7.2 from performing the F3 key's default action of opening the Find dialog. I'm unable thus far to prevent the Find dialog from...
6
by: PerryC | last post by:
I have search googles and there are hundreds of tips about AllowByPassKey... however, none works for me... well, perhaps I am too new to such high level functionality that it just does not make...
388
by: maniac | last post by:
Hey guys, I'm new here, just a simple question. I'm learning to Program in C, and I was recommended a book called, "Mastering C Pointers", just asking if any of you have read it, and if it's...
1
by: Ajab Gajab | last post by:
Hi All, I am developing an application in VB.Net where I need to provide user with cancelling or stopping the current print job. Like, if a user clicks on "stop" button, then printer should print...
2
by: Mark Anderson | last post by:
Is it possible to identify the action of a user cancelling by the user of file download dialog? (as opposed to something else being captured. Ideally I'd like to do this for a IE6+/FF v1.5+/Safari...
3
by: Amy Smith | last post by:
Hello there, I am having a small problem which been challenging me for few days and need help or advice. I am trying to calculate the day-shift for employees based on the time they started and...
2
by: ruthie | last post by:
Hi, I have a gridview with edit option. If the user chooses to edit the row and then press the Cancel button - I would like the focus to return to the chosen row. Someone has any idea how to...
2
by: maralfarshadi | last post by:
Hi I have a hyperlink in my form, and I am using: <a href="javascript:myFunction('myTextBox','myFormName','ServletName')"> Go </a> In my Javascript code, if all goes well, the form gets...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.